//2.利用冒泡排序将数据由大到小排序
#include<stdio.h>
int main()
{
	int a[] = {12, 23, 25, 33, 2, 6, 45, 16, 11, 65};
	int i,j,t,n;
	n = sizeof(a) / sizeof(a[0]);
	printf("初始数组为：");
	for(i = 0; i < n; i++)
	{
		printf("%3d",a[i]);
	}
	printf("\n");
	for(i = 0; i < n-1; i++)
	{
		for(j = 0; j < n-1-i ; j++)
		{
			if(a[j] < a[j+1])
			{
				t = a[j+1];
				a[j+1] = a[j];
				a[j] = t;
			}
		}
	}
	printf("结果数组为：");
	for(i = 0; i < 10; i++)
	{
		printf("%3d",a[i]);
	}
	printf("\n");
	return 0;
}
